package com.zzy.module.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzy.common.entity.db.PermissionDaoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * @author zhuZhaoYang
 * @date 2021/12/4 19:29
 */
@Mapper
public interface PermissionMapper extends BaseMapper<PermissionDaoEntity> {

    /**
     * 获取用户权限
     *
     * @param actorId 角色类型
     * @return 权限列表
     */
    @Select("select permission.permission from permission where " +
            "permission.actorType=#{actorID}")
    Set<String> getAllPermissionByActorId(@Param("actorID") int actorId);
}
